<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form action="服务器地址" id="myform">
        <input type="text" name="username">
        <button id="resetbtn">重置</button>
        <button>提交</button>
        <!-- 无需任何内容即可提交 -->
    </form>

    <script>
        var resetbtn = document.getElementById('resetbtn')
        var myform = document.getElementById('myform')

        resetbtn.addEventListener('click',function(){
            myform.reset()//重置表单中内容
        })

        myform.addEventListener('submit',function(){
            alert('已提交')//提交后会将内容提交给action处的服务器地址，没有就在url处加上提交内容
        })
    </script>
</body>
</html>